package com.mz.mattress.client.service.impl;

import com.mz.mattress.api.entity.PlanConfig;
import com.mz.mattress.api.entity.PlanDate;
import com.mz.mattress.api.util.DateUtil;
import com.mz.mattress.client.mapper.PlanConfigMapper;
import com.mz.mattress.client.mapper.PlanDateMapper;
import com.mz.mattress.client.service.PlanConfigService;
import com.mz.mattress.client.util.RandomGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Slf4j
@Service
public class PlanConfigServiceImpl implements PlanConfigService {

    @Autowired
    private PlanConfigMapper planConfigMapper;

    @Autowired
    private PlanDateMapper planDateMapper;

    @Override
    public void initDailyData() {

//        String nowDate = DateUtil.getNowDate();
//
//        PlanDate planDate = planDateMapper.selectByDates(nowDate);
//        if (planDate == null) {
//
//            PlanConfig config = planConfigMapper.selectById(1);
//
//            int count = RandomGenerator.nextInt(config.getMemberCountMin(), config.getMemberCountMax());
//
//            planDate = new PlanDate();
//            planDate.setDates(nowDate);
//            planDate.setMemberCount(count);
//            planDateMapper.insert(planDate);
//
//        }

    }


}
